package com.sk.cardeal.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sk.cardeal.R;
import com.sk.cardeal.entity.Parts;
import com.sk.cardeal.entity.PartsListBean;

import java.util.List;

/**
 * Created by sk on 2018/1/12.
 */

public class PartsAdapter extends BaseQuickAdapter<Parts, BaseViewHolder> {

    public PartsAdapter(int layoutResId, @Nullable List<Parts> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, Parts item) {

        helper.addOnClickListener(R.id.reduce)
                .addOnClickListener(R.id.add)
        .setText(R.id.part_name,item.getName())
        .setText(R.id.tv_money,item.getPrice()+"元起")
        .setText(R.id.vin_num,"VIN:"+item.getVin())
        .setText(R.id.parts_code,"零部件编码:"+item.getPartsSelfCode())
        .setText(R.id.mall_code,"商品码:"+item.getGoodsCode())
        .setText(R.id.tv_stock,"库存:"+item.getCount())
        .setText(R.id.edit_num,String.valueOf(item.getSelectCount()));

    }
}
